home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / The Director v1.2.adf / library / ckbdwipe next >
Text File  |  1988-05-08  |  1KB  |  47 lines

  1.  
  2. REM here is a basic checkerboard wipe routine.
  3. REM to use, include this in your program, and then
  4. REM you need to set up the variable "ckbfrom" to
  5. REM be the buffer number of the buffer you want to wipe from
  6. REM and then do a GOSUB 9000.
  7.  
  8. REM this routine uses line number 9000,9001 and 9002.
  9. REM and variables:  ckbfrom, ckbw, ckbh, ckbx, ckby, ckbX, ckbY
  10.  
  11.  
  12. rem  *** do a checkerboard wipe
  13.  
  14. 9000 resolution -1,ckbw,ckbh,ckbx
  15.     ckbw=(ckbw+7)/8
  16.     ckbh=(ckbh+7)/8
  17.  
  18. rem checkerboard phase 1
  19.  
  20. REM   if you swap the two FOR's or swap the 7 and 0 on either FOR
  21. REM   you can get it to wipe in various directions, up and down,
  22. REM   left to right, etc.
  23.  
  24.     for ckbx=0 to 7
  25.       for ckby=0 to 7
  26.         if (ckbx+ckby)%2=0:goto 9001:endif
  27.         ckbX=ckbx*ckbw
  28.         ckbY=ckby*ckbh
  29.        blit ckbfrom,ckbX,ckbY,ckbX,ckbY,ckbw,ckbh
  30.        REM  you can put a short pause here to slow down the wipe
  31. 9001  next
  32.     next
  33.  
  34. rem checkerboard phase 2
  35.  
  36.     for ckbx=7 to 0
  37.       for ckby=7 to 0
  38.         if (ckbx+ckby)%2:goto 9002:endif
  39.         ckbX=ckbx*ckbw
  40.         ckbY=ckby*ckbh
  41.         blit ckbfrom,ckbX,ckbY,ckbX,ckbY,ckbw,ckbh
  42.         REM a pause would go here
  43. 9002  next
  44.     next
  45.     return
  46.  
  47.